package gazebo;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import java.util.List;

public class Client {
    public static void main(String[] args) throws TException {
        TTransport transport = new TSocket("localhost", 9091); // 127.0.0.1
        transport.open();
        TProtocol protocol = new TBinaryProtocol(transport);
        gazeboThriftService.Client client = new gazeboThriftService.Client(protocol);
        String content = "【我是请求测试Gazebo的联通】";
        String result = client.sayHello(content);
        System.out.println("测试联通Gazebo的结果为：" + result);
        List obs = client.startReset();
        System.out.println("obs：" + obs);

        observation ObsValues = client.startStep(1);
        System.out.println("下一步的观测值为" + ObsValues.obs);
        System.out.println("奖励值为" + ObsValues.reward);
        System.out.println("是否重置" + ObsValues.done);
    }
}
